Conversation
|
Apparently there are some IE9-related issues with regl. |
src/plot_api/plot_api.js
Outdated
There was a problem hiding this comment.
Ha. regl must be invoking one or many globals that IE9 doesn't support at runtime.
As this file here plot_api.js is required in all partial bundles (even that gl-less ones), this makes the IE9 test fail.
So, I think the best to solve this would be use a Registry.getComponentMethod-style pattern so that regl is only required in bundles that expose regl traces.
There was a problem hiding this comment.
@etpinard do I get it right that we don't have this safe-require pattern yet? What if I just require regl directly when the regl trace type is detected?
There was a problem hiding this comment.
What if I just require regl directly when the regl trace type is detected?
You mean something like:
if(fullLayout._has('regl')) {
var createREGL = require('regl')
}in plot_api.js? That could work, but regl would still get bundled up in all partial bundles.
src/plot_api/plot_api.js
Outdated
| } | ||
|
|
||
| // check trace | ||
| var modules = this._modules || []; |
| x: 0, | ||
| y: 0, | ||
| width: canvas.width, | ||
| height: canvas.height, |
| // explicitly delete anything | ||
| fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container') | ||
| .data([0]); | ||
| .data([{}]); |
There was a problem hiding this comment.
what about this one here?
There was a problem hiding this comment.
that is the way parcoords is doing it's thing: https://github.com/plotly/plotly.js/pull/2159/files#diff-2fad23de82bf8c7625ea8e11436233b7R290
I did not really try to figure out why it is done this and not the another way. Before it used own container for storing this data. If that matters, I can try to keep this object within parcoords use.
There was a problem hiding this comment.
Does it work ok with data([0])?
There was a problem hiding this comment.
@etpinard that is the point that parcoords puts vm property there via extendFlat, that is why it should be an object. Probably it is possible to find a better storage for it, I just did not figure out what.
src/plot_api/plot_api.js
Outdated
There was a problem hiding this comment.
I think you need a key-function here to make sure to not create these canvas nodes on every hard redraw that go through drawFramework.
Sometime like:
fullLayout._glcanvas = fullLayout._glcontainer.selectAll('.gl-canvas').data([{
/* .. as currently ... */
}], function(d) { return d.key; });There was a problem hiding this comment.
This makes me wonder: we probably don't have sufficient test coverage for Plotly.restyle calls that morph a gl-based trace types into a SVG-based. For example off the regl2d branch we should have:
Plotly.newPlot(gd, [{
type: 'scattergl',
// ...
}])
.then(function() {
d3.selectAll('canvas').size() // => 3
return Plotly.restyle(gd, 'type', 'scatter')
})
.then(function() {
d3.selectAll('canvas').size() // => 0
})As restyling a parcoords traces into any other trace types doesn't make much sense at the moment. You could instead try something like:
Plotly.newPlot(gd, [{
type: 'parcoords',
// ...
}])
.then(function() {
d3.selectAll('canvas').size() // => 3
return Plotly.deleteTraces(gd, [0])
})
.then(function() {
d3.selectAll('canvas').size() // => 0
})
src/plots/plots.js
Outdated
There was a problem hiding this comment.
oldFullLayout._glcontainer.selectAll('.gl-canvas').remove()should suffice.
|
@dfcreative Good news the parcoords tests are passing again Bad news other Can you try making |
|
@etpinard fixed these four noCI tests, seems that others (mapbox ones) are not related to this PR but are specific to my machine. |
Yeah, those mapbox tests are pretty resource-intensive; that doesn't surprise me. Hopefully #2029 will fix those issues. Great PR. Merge away 💃 |

Excerpt from #1869.
Covers #1993 and #1989.